home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / boltzio.inh < prev    next >
Text File  |  1993-08-23  |  4KB  |  143 lines

  1. inst4.1
  2. !****************************************************************
  3. !*                                *
  4. !*    Boltzman Network Generator - Input/Output version    *
  5. !*                                *
  6. !****************************************************************
  7.  
  8. !    *** check that input PE count is non-zero
  9.  
  10. ?&In    1
  11. >bge    CheckHid
  12. @Err    "Boltzmann I/O model MUST have at least one input PE"
  13. :CheckHid
  14. ?&Hd1    1
  15. >bge    CheckOut
  16. @Err    "Boltzmann I/O model MUST have at least one hidden PE"
  17. :CheckOut
  18. ?&Out    1
  19. >bge    OutOK
  20. @Err    "Boltzmann I/O model MUST have at least one output PE"
  21. :OutOK
  22.  
  23. !    *** Load the Control Strategy and LRS if needed
  24.  
  25. @LdCS    "boltzio"        !control strategy
  26. @LdLR    "boltzman"        !L/R schedule
  27.  
  28. =netn    "InstaNet (tm) Boltzmann Network (I/O model) version 1.00 17-04-89"
  29. =DLnF    0            !learn  re-display off
  30. =DRcF    0            !recall re-display off
  31.  
  32. !    *** Build the Input Layer ***
  33.  
  34. @LLdf                !load default layer to mi_layer structure
  35. =LDln    "In"            !layer name
  36. =Lpes    &In            !copy # of input PEs from menu
  37. =Ltrn    "StepFunction"        !transfer function
  38. =x    100            !place to put layer on screen
  39. =y     50
  40. #Incl    "stdnwgtf.iif"        !standard # weight fields
  41. @LAdd                !add the input layer
  42. =n0    LayN            !track input layer
  43.  
  44. !    *** Build the Boltzmann Layer ***
  45.  
  46. @LLdf                !start with default layer again
  47. =LDln    "Boltzmann"        !layer name
  48. =Lpes    &In            !desired number of PEs
  49. +Lpes    &Hd1
  50. +Lpes    &Out
  51. =Ltrn    "Boltzmann"        !transfer function
  52. =Llrn    "Boltzmann"        !learning rule
  53. =Llrs    "boltzman"        !L/R schedule
  54. =LInL    0.0            !low initialization limit
  55. =LInH    0.0            !high initialization limit
  56. +y    170            !up higher on display
  57. #Incl    "stdnwgtf.iif"        !standard # weight fields
  58. @LAdd
  59. =n1    LayN            !track Boltzmann layer
  60.  
  61. !    *** Connect input layer to Boltzmann layer ***
  62.  
  63. =SPEl    LayN            !current layer
  64. @SlPE
  65. =NPEl    n0            !input layer
  66. @NrPE
  67. =cnwt    1.0            !unit weight
  68. =cnsc    WRel
  69. =cnty    WSet
  70. @LCCr                !connect corresponding items
  71.  
  72. !    *** Connect Boltzmann layer to itself ***
  73.  
  74. =NPEl    LayN
  75. @NrPE
  76. =cnwt    0.0            !zero weights
  77. =cnty    WVar            !trainable
  78. =cnsc    WAbs
  79. @LCFl                !fully connect (except diagonal)
  80.  
  81. !    *** Connect the bias to the Boltzmann layer ***
  82.  
  83. =NPEl    -1
  84. @NrPE
  85. =cnwt    0.0            !zero weights
  86. =cnty    WVar            !trainable
  87. =cnsc    WAbs
  88. @LCFl                !fully connect (except diagonal)
  89.  
  90. !    *** Build the Output Layer ***
  91.  
  92. @LLdf                !start with default layer again
  93. =LDln    "Output"        !layer name
  94. =Lpes    &Out            !desired number of PEs
  95. =Ltrn    "StepFunction"        !transfer function
  96. =LInL    0.0            !low initialization limit
  97. =LInH    0.0            !high initialization limit
  98. +y    60            !up higher on display
  99. #Incl    "stdnwgtf.iif"        !standard # weight fields
  100. @LAdd
  101. =n2    LayN            !track output layer
  102.  
  103. !    *** Connect the Boltzmann layer to the Output layer ***
  104.  
  105. =SPEl    LayN            !output layer
  106. =SPEn    0
  107. =NPEl    n1            !Boltzmann layer
  108. =NPEn    &In
  109. =cnwt    1.0            !set weight to 1.0
  110. =cnty    WFix            !fixed weight
  111. =cnsc    WRel            !relative connections
  112. :B2OCn                !Boltzmann to output connections
  113. @SlPE                !select next PE in output layer
  114. @NrPE                !select next PE in Boltzmann layer
  115. @PCon                !connect two PEs together
  116. +SPEn    1            !next PE in output layer
  117. ?SPEn    &Out            !past the end?
  118. >bge    EndB20            !Connection complete
  119. +NPEn    1            !next PE in the Boltzmann layer
  120. >br    B2OCn            !next connection
  121. :EndB20
  122.  
  123. @LLsl                !load super layer
  124. =Lctl    "boltzio"        !control strategy
  125. =Llnn    "boltzman"        !name of learn input
  126. =Lrcn    "boltzman"        !name of recall output
  127. #Incl    "stdioset.iif"        !standard I/O settings
  128. =Lax1    Epch            !epoch size
  129. =Lax2    10            !nominal number of firings per iteration
  130. =Lax3    20            !nominal # of iterations for collecting stats
  131. =Lscl    -1            !input  low-value
  132. =Loff     1            !input  high-value
  133. =Llow     0            !output low-value
  134. =Lhgh     1            !output high-value
  135. @SVsl                !save it back
  136. !
  137. =jogl    -.1            !lower limit for jog
  138. =jogh    +.1            !upper limit for jog
  139. =seed    257            !starting seed number
  140. @seed                !set the seed
  141. @Nini                !initialize the network
  142. @EOF
  143.